1. Field of the Disclosure
The present disclosure relates to a method for saving fault wave data, and more particularly, to a method for saving fault wave data, in which when a fault wave generated in a system is saved, a size of wave data is calculated, and the saving of the wave data is performed according to the size of the wave data, so that it is possible to implement the use of spaces of a buffer and a memory and the simultaneous saving of wave data simultaneously or subsequently generated.
2. Description of the Background Art
FIG. 1 is a block diagram illustrating a wave data saving function of a typical digital relay, which shows a scheme of saving fault wave data when a fault occur in a system having a relay built therein.
In general, when a fault occurs, several relay elements are simultaneously or consecutively operated, but only about one fault wave data is saved at a specific point of time (e.g., the first fault among several faults) according to the performance of a device, based on the first fault.
Basic facts in saving of wave data, which was conventionally applied, are as follows.                Wave raw data is recorded in an internal buffer from an operation board at every 1 ms.        If a wave source is generated according to settings of an HMI, a start signal is generated such that wave data is recorded in a flash memory in main processing.        The other wave data except a pre-cycle are recorded by the start signal. If the recording is completed, subsequently input data are recorded without omission by using another buffer.        An identifier of a specific block area is provided and managed by an external request (manager) such that saved wave data can be transmitted with a defined frame through communication.        
An operation scheme of acquiring raw data at every 1 ms from a DSP and saving the acquired raw data in a buffer is as follows.                Position of saving command: an interrupt operation is performed at ever 1 ms.        A raw data pointer of the operation board is received at every time to save the received raw data pointers in the buffer from a previous time to a current sample pointer.        The buffer per channel is operated to have a number (a size twice greater than 128 cycles*64 samples*1 channel=8192) where data can be maximally saved or operated to save the data        
An example in which fault wave data is saved in a buffer through the above-described principle is illustrated in FIGS. 2 and 3.
FIG. 2 is a graph 1 illustrating an example in which fault wave data is saved in a buffer according to a conventional art.
FIG. 3 is a graph 2 illustrating the example in which the fault wave data is saved in the buffer according to the conventional art.
When first wave data is saved, a first buffer uses an arrangement of 0 to 8192 as shown in FIG. 2, and a second buffer in which instantaneous raw data is saved during the saving of wave data uses an arrangement of 8193 to the end as shown in FIG. 3.
The conventional method for saving fault wave has problems as follows.
In the case of a fault wave, a large amount of data should be managed and saved. However, the function of writing data in a nonvolatile memory cannot exceed about 20 to 30 bytes per 1 ms, based on a FRAM. In the case of other memories (a flash memory, etc.), the time required to write data may be further increased. Such a time limitation should be maintained such that the real-time performance of a relay operation. However, due to difficulty in managing and saving data, the number of buffers is specified as 1 or 2, and it is difficult to save another wave data until the writing of the data is completed. Therefore, when faults are consecutively generated, new fault wave data cannot be saved within a wave data saving time (1 to 2 seconds in a fast case or 7 to 8 seconds in a late case).
After a point of time when a fault occurs is specified, the method for collecting and writing all buffer data of the corresponding point of time and the corresponding fault can be performed only when fault wave data are all retained. Therefore, the size of the buffer should be increased, and another real-time raw data should be saved in the buffer while the wave data is saved. Hence, the size of the buffer becomes double without condition. The waste of the memory due to the increase in size is unavoidable.
In the conventional configuration, only one wave data is recorded when multiple faults occur according to the operation of an instantaneous relay element (less than 50 ms) having the shortest fault time, due to the limitation of H/W performance and in terms of S/W. In addition, there is no record for faults having an interval between the total wave cycle in which wave data is saved and a point of time when the saving of the wave data is completed. For example, if the period in which wave data is saved is two seconds, and the time required to save the wave data is five seconds, there may be no data capable of analyzing faults occurring during an interval of three seconds.
When a fault is generated in a system, and accordingly, multiple faults are consecutively generated, a relay controls a circuit breaker to separate the corresponding system. In this case, saved wave data becomes a basis for inferring how the quantity of electricity in the system is changed in examination of situations and causes. Hence, the saved wave data becomes an important factor in the reliability and performance of a device. In addition, relay manufacturers frequently do business by using, as specifications, a number of fault wave data to be saved, a period in which the fault wave data is saved, and the like.
However, in the conventional method, fatal disadvantages definitely exist due to the above-described reasons, and wave data cannot be saved in a specific situation. Therefore, the image of products is deteriorated together with the reliability of the device.
When a memory is used by setting the size of the memory to be excessively large, it is important to manage the memory in a stack area and a heap area. This causes a fatal error such as memory leak or stack overflow, and therefore, the device may erroneously operate.